package com.popo.android.receiver;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.media.AudioManager;
import android.media.MediaPlayer;
import android.text.StaticLayout;

import com.popo.android.StartActivity;
import com.popo.android.activity.MediaPlayerActivity;


public class HeadSetPlug extends BroadcastReceiver {
    
    public static int i;

    @Override
    public void onReceive(Context context, Intent intent) {
        // TODO Auto-generated method stub
        i++;
        System.out.println("HeadSetPlug receiver:"+intent.getAction()+","+intent.getIntExtra("state", 0)+","+intent.getStringExtra("name")+","+intent.getIntExtra("mic", 0));
        Intent i = new Intent(context, MediaPlayerActivity.class);
        i.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
//        context.startActivity(i);
    }

}
